
<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="utf-8">
		<title>Demo</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">

		<!-- 引入jQuery -->
		<script src="../jquery.min.js"></script>

		<script src="../webuploader.min.js"></script>
		<!-- 插件核心 -->
		<script src="../Eleditor.min.js"></script>
		<!--<script src="https://unpkg.com/qiniu-js@<version>/dist/qiniu.min.js"></script>-->

		<style>
			* {
				margin: 0;
				padding: 0;
			}
			
			body {
				-webkit-touch-callout: none;
				background-color: #fff;
				line-height: inherit;
				padding-top: 30px;
			}
			#article-body{
				padding: 0 .5em;
			}
			#contentEditor {
				width: 100%;
				min-height: 300px;
				box-sizing: border-box;
				padding: 10px;
				color: #444;
			}
			
			#contentEditor p {
				letter-spacing: 0.25px;
				padding: .5em;
				/*font: 16px/25px Tahoma, Verdana, 宋体;*/
				text-align: center;
				background: rgb(249,167,49);
				/*border-radius: .4em;*/
				font-size: 1em;
				color: #fff;


			}
			
			#contentEditor h4 {
				font-weight: bold;
				line-height: 1.333em;
				margin: 10px 0 20px;
				padding: 25px 0 0;
			}
			
			#contentEditor img {
				width: 100%;
				height: auto;
				box-sizing: border-box;
			}
			
			.dempTip {
				border-left: 2px solid #00BCD4;
				padding-left: 5px;
				margin: 10px;
				font-size: 16px;
			}
			
			code {
				white-space: pre-wrap;
				background: #2D2D2D;
				display: block;
				margin: 10px;
				border-radius: 5px;
				color: #fff;
			}
			
			.viewTit {
				color: #FF5722;
				position: fixed;
				top: 0;
				left: 0;
				height: 30px;
				line-height: 30px;
				font-size: 14px;
				text-align: center;
				display: block;
				width: 100%;
				background: #FFEB3B;
				box-shadow: 0 0 5px;
			}
			img{
			max-width:90%;
			}
		</style>
	</head>

	<body>

		<!-- 内容编辑区域 -->
		<div id="article-body">内容编辑区</div>
		
		<script>
			function getId() {
				if(Obj.getId() != "" && Obj.getId() != null) {

					$.ajax({
						type: "POST",
						url: "http://zhishang.hlhjapp.com/app/v1/breakup/get",
						data:{
							id:Obj.getId(),
							token:Obj.getToken()
						},
						dataType: "json",
						success: function(res) {
							if(res.code == 1){
								$("#article-body").html(res.data.content);

							}else{
								alert(res.msg);
							}

						}
					});

				} else {

				}
			}
			getId();
			
			//返回富文本
			function getEl(){
			Obj.commit($("#article-body").html())
				<!--alert("富文本");-->
				<!--return $("#article-body").html();-->
				return '< >';
			}
			

			new Eleditor({
				el: "#article-body",
				upload: {
					server: 'http://zhishang.hlhjapp.com/app/v1/public/upimages', //后台接收地址
					fileSizeLimit: 2, //限制文件上传大小为2M
					formName: 'file', //设置文件name,

					accept: { //accept一般不用设置
						title: 'Images',
						extensions: 'gif,jpg,jpeg,bmp,png,webp',
						mimeTypes: 'image/gif,image/jpg,image/jpeg,image/bmp,image/png,image/webp'
					}
				}
			});



		</script>

	</body>

</html>